import ResourceIcon from './ResourceIcon/schema';
import ResourceContent from './ResourceContent/schema';

function handleResizable(schema: { editableData: any }) {
  const arr = schema.editableData.map((item: { key: string }) => item.key);
  return {
    ...schema,
    enableResizing: arr.includes('width') && arr.includes('height'),
  };
}
const resourceLibrarySchema = {
  ResourceIcon: handleResizable(ResourceIcon),
  ResourceContent: handleResizable(ResourceContent),
};
export default resourceLibrarySchema;
